<template>
  <div>
    <el-row>
      <el-col :span="18">
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
          <el-form-item label="选择订单" prop="region">
            <el-select v-model="ruleForm.region" multiple filterable clearable style="width: 100%;" placeholder="请选择选择订单">
              <el-option label="BXZPC171765997400038630944/金额50" value="BXZPC171765997400038630942"></el-option>
              <el-option label="BXZPC171765997400038630944/金额51" value="BXZPC171765997400038630943"></el-option>
              <el-option label="BXZPC171765997400038630944/金额52" value="BXZPC171765997400038630944"></el-option>
              <el-option label="BXZPC171765997400038630944/金额53" value="BXZPC171765997400038630945"></el-option>
              <el-option label="BXZPC171765997400038630944/金额54" value="BXZPC171765997400038630946"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="订单金额" prop="name">
            <div class="money"><span>¥</span> 50.00</div>
          </el-form-item>
          <el-form-item label="发票类型" prop="resource">
            <el-radio-group v-model="ruleForm.resource">
              <el-radio label="企业"></el-radio>
              <el-radio label="非企业"></el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="发票抬头" prop="name">
            <el-input v-model="ruleForm.name" placeholder="请输入发票抬头"></el-input>
          </el-form-item>
          <el-form-item label="纳税人识别号" prop="name">
            <el-input v-model="ruleForm.name" placeholder="请输入纳税人识别号"></el-input>
          </el-form-item>
          <el-form-item label="开户行名称" prop="name">
            <el-input v-model="ruleForm.name" placeholder="请输入开户行名称"></el-input>
          </el-form-item>
          <el-form-item label="开户行账号" prop="name">
            <el-input v-model="ruleForm.name" placeholder="请输入开户行账号"></el-input>
          </el-form-item>
          <el-form-item label="公司地址" prop="name">
            <el-input v-model="ruleForm.name" placeholder="请输入公司地址"></el-input>
          </el-form-item>
          <el-form-item label="公司电话" prop="name">
            <el-input v-model="ruleForm.name" placeholder="请输入公司电话"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
            <el-button @click="resetForm('ruleForm')">重置</el-button>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="6"></el-col>
    </el-row>

  </div>
</template>

<script>
import {decrypt} from "@/utils/AES";

export default {
  data() {
    return {
      ruleForm: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      rules: {
        name: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
          { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
        ],
        region: [
          { required: true, message: '请选择活动区域', trigger: 'change' }
        ],
        date1: [
          { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
        ],
        date2: [
          { type: 'date', required: true, message: '请选择时间', trigger: 'change' }
        ],
        type: [
          { type: 'array', required: true, message: '请至少选择一个活动性质', trigger: 'change' }
        ],
        resource: [
          { required: true, message: '请选择活动资源', trigger: 'change' }
        ],
        desc: [
          { required: true, message: '请填写活动形式', trigger: 'blur' }
        ]
      }
    };
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert('submit!');
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }
  },
  mounted() {
    console.log(1231231231231212123123123,decrypt('uPeQuasGaovy3DgCJluIKg=='))
  }
}
</script>

<style scoped lang="scss">
.money{
  font-size: 18px;
  color: #333;
  font-family: 'OPPOB', sans-serif;
  span{
    font-size: 12px;
  }
}
</style>